package com.zhixi.pattern.important.proxypattern.JDK;

import com.zhixi.pattern.important.proxypattern.JDK.operation.GamePlayerProxy;
import com.zhixi.pattern.important.proxypattern.JDK.operation.IGamePlayer;
import com.zhixi.pattern.important.proxypattern.JDK.operation.User;

/**
 * JDK动态代理模式
 *
 * @作者 ShuHaoNan
 * @邮箱 shuhaonan1@gmail.com
 * @时间 2020/11/15 16:34
 */
public class JDKProxyPattern {

    public static void main(String[] args) {
        IGamePlayer proxy = (IGamePlayer) new GamePlayerProxy(new User("张三")).getProxyInstance();
        proxy.login("admin", "admin");
        proxy.killBoos();
        proxy.upgrade();
    }

}
